<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.zjr.domain.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="<%=path %>/skin/css/base_style.css" />
<link type="text/css" rel="stylesheet" href="<%=path %>/skin/css/form.css" />
<script type="text/javascript" src="<%=path %>/skin/js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="<%=path %>/skin/js/form.js"></script>
<%
	Log log = (Log)request.getAttribute("log");
	String flag = "selected";
	HttpSession userSession = request.getSession();
	User user = (User)userSession.getAttribute("user");
	String state = "";
	if(user.getPosition() == 0){
		switch(log.getState()){
		case 0: state = "未审核";break;
		case 1: state = "审核中";break;
		case 2: state = "通过审核";break;
		}
	}
%>
</head>
<body>
<form action="<%=path %>/LogServlet?flag=modify" class="fm" method="post">
	<table class="fm_tab" align="center">
		<tr>
			<td width="15%" class="fm_td1 fyh"><img src="<%=path %>/skin/images/form_img_03.png" class="fm_mid"/><span class="fm_text">提交者：</span></td>
			<td width="35%" class="fm_td2"><input type="text" name="username" value="<%=log.getUsername() %>" class="fm_tt1" style="width:80%" readonly/></td>
		</tr>
		<tr>
			<td width="15%" class="fm_td1 fyh"><img src="<%=path %>/skin/images/form_img_03.png" class="fm_mid"/><span class="fm_text">提交地点：</span></td>
			<td width="35%" class="fm_td2"><input type="text" name="place" value="<%=log.getPlace() %>" class="fm_tt1" style="width:80%" readonly /></td>
		</tr>
		<tr>
			<td width="15%" class="fm_td1 fyh"><img src="<%=path %>/skin/images/form_img_03.png" class="fm_mid"/><span class="fm_text">工作时长：</span></td>
			<td width="35%" class="fm_td2"><input type="text" name="duration" value="<%=log.getDuration() %>" class="fm_tt1" style="width:30%" readonly/><span class="fm_text">小时</span></td>
		</tr>
		<tr>
			<td width="15%" class="fm_td1 fyh"><img src="<%=path %>/skin/images/form_img_03.png" class="fm_mid"/><span class="fm_text">提交时间：</span></td>
			<td width="35%" class="fm_td2"><input type="text" name="submittime" value="<%=log.getSubmittime() %>" class="fm_tt1" style="width:80%" readonly /></td>
		</tr>
		<tr>
			<td width="15%" class="fm_td1 fyh"><img src="<%=path %>/skin/images/form_img_03.png" class="fm_mid"/><span class="fm_text">日志状态：</span></td>
			<td width="35%" class="fm_td2">
				<select name="state">
				<%
					if(user.getPosition() == 0){
						%>
							<option value="<%=log.getState()%>"><%=state %></option>
						<%
					}else if(user.getPosition() == 1){
						%>
							<option value="0" <%=log.getState() == 0 ? flag : "" %>>未审核</option>
							<option value="1" <%=log.getState() == 1 ? flag : "" %>>审核中</option>
						<%
					}else{
						%>
							<option value="0" <%=log.getState() == 0 ? flag : "" %>>未审核</option>
							<option value="1" <%=log.getState() == 1 ? flag : "" %>>审核中</option>
							<option value="2" <%=log.getState() == 2 ? flag : "" %>>通过审核</option>
						<%
					}
				%>
				</select>
			</td>
		</tr>
		<tr>
        	<td class="fm_td3 fyh"><span class="fm_text">日志内容：</span></td>
            <td class="fm_td4" colspan="3"><textarea style="width: 80%; height: 130px;" name="content" class="fm_textarea"><%=log.getContext() %></textarea></td>
         </tr>
		<tr>
         	<td class="fm_td5" colspan="4">
         		<input type="hidden" name="lid" value="<%=log.getLid() %>" />
         		<input type="submit" class="fm_button fyh" value="提&nbsp;&nbsp;&nbsp;&nbsp;交"/>
            </td>
         </tr>
	</table>
</form>
</body>
</html>